import { Navbar } from "@/components/Navbar";
import { Footer } from "@/components/Footer";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Textarea } from "@/components/ui/textarea";
import { Badge } from "@/components/ui/badge";
import { useLanguage } from "@/contexts/LanguageContext";
import { Settings, Zap, Save, Eye, Share, Download } from "lucide-react";
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";
import { TemplateLibrary } from "@/components/TemplateLibrary";
import { SmartCoursewareAssembly } from "@/components/SmartCoursewareAssembly";
import { ClassroomAnalytics } from "@/components/ClassroomAnalytics";
import { AIGradingAssistant } from "@/components/AIGradingAssistant";
import { PBLCaseWorkshop } from "@/components/PBLCaseWorkshop";
import { useState } from "react";
import { SmartWritingCanvas } from "@/components/SmartWritingCanvas";

const SmartBuilder = () => {
  const { t } = useLanguage();
  const [mainTab, setMainTab] = useState("template-library");
  const [templateTab, setTemplateTab] = useState("all-templates");

  const templates = [
    {
      name: "Interactive Science Lab",
      description: "Hands-on experiments with digital documentation",
      subjects: ["Science", "STEM"],
      duration: "90 minutes"
    },
    {
      name: "Literature Analysis Workshop",
      description: "Deep dive into text analysis and discussion",
      subjects: ["English", "Literature"],
      duration: "60 minutes"
    },
    {
      name: "Math Problem Solving",
      description: "Step-by-step mathematical reasoning",
      subjects: ["Mathematics"],
      duration: "45 minutes"
    }
  ];

  return (
    <div className="min-h-screen flex flex-col bg-gray-50">
      <Navbar />

      <main className="flex-1 py-8">
        <div className="container mx-auto px-4">
          <Tabs value={mainTab} onValueChange={setMainTab} className="w-full">
            <TabsList className="mb-8 grid grid-cols-3 gap-2">
              <TabsTrigger value="template-library">Template Library</TabsTrigger>
              <TabsTrigger value="smart-courseware">Smart Courseware</TabsTrigger>
              <TabsTrigger value="smart-writing">Smart Writing</TabsTrigger>
            </TabsList>
            <TabsContent value="template-library">
              <Tabs value={templateTab} onValueChange={setTemplateTab} className="w-full">
                <TabsList className="mb-4">
                  <TabsTrigger value="all-templates">All Templates</TabsTrigger>
                  <TabsTrigger value="pbl-cases">PBL Case Workshop</TabsTrigger>
                </TabsList>
                <TabsContent value="all-templates">
                  <TemplateLibrary />
                </TabsContent>
                <TabsContent value="pbl-cases">
                  <PBLCaseWorkshop />
                </TabsContent>
              </Tabs>
            </TabsContent>
            <TabsContent value="smart-courseware">
              <SmartCoursewareAssembly />
            </TabsContent>
            <TabsContent value="smart-writing">
              <SmartWritingCanvas />
            </TabsContent>
            {/* Assessment Assistant 选项卡和内容已移除 */}
          </Tabs>
        </div>
      </main>

      <Footer />
    </div>
  );
};

export default SmartBuilder;
